/* 基础布局样式 - 使用flex确保页脚固定在底部 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* 主内容区域自动扩展 */
main.flex-grow-1 {
    flex: 1;
    padding-bottom: 20px;
}

/* 导航栏样式优化 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem 0;
}

.navbar-dark .navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9);
    transition: color 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #fff;
}

.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    font-weight: 500;
}

/* 卡片样式优化 */
.card {
    margin-bottom: 24px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.card-header {
    background-color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.card-body {
    padding: 1.25rem;
}

/* 按钮样式优化 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

.btn-success {
    background-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
}

/* 表单元素样式优化 */
.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.6rem 0.75rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    height: 42px; /* 统一表单控件高度 */
    display: block;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
    outline: none;
}

/* 下拉选择框样式优化 */
select.form-control {
    padding: 0.4rem 2rem 0.4rem 0.75rem; /* 调整内边距使文字更居中 */
    height: 42px; /* 与其他表单控件统一高度 */
    line-height: 1.8; /* 增加行高使文字垂直居中 */
    font-size: inherit;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.75rem center; /* 确保图标垂直居中 */
    background-size: 16px 12px;
    -webkit-appearance: none; /* 移除浏览器默认样式 */
    -moz-appearance: none;
    appearance: none;
    vertical-align: middle;
}

/* 文件选择输入框样式优化 */
input[type="file"].form-control {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    height: 48px; /* 单独设置高度以解决居中问题 */
    font-size: inherit;
    line-height: 1.5;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

/* 标签样式优化 */
.badge {
    font-size: 0.75em;
    padding: 0.5em 0.75em;
    border-radius: 20px;
    font-weight: 500;
}

/* 表格样式优化 */
.table {
    margin-bottom: 0;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* 评论样式优化 */
.media {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.media:hover {
    background-color: #f8f9fa;
}

.media:last-child {
    border-bottom: none;
}

/* 页脚样式 - 固定在底部 */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* 通知消息样式 */
.alert {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 响应式设计优化 */
/* 大屏幕设备 */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
}

/* 平板和桌面设备 */
@media (min-width: 768px) {
    .container {
        max-width: 1140px;
    }
}

/* 小平板和手机设备 */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .form-row {
        display: block;
    }
    
    .form-group.col-md-4 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* 调整卡片和间距 */
    .card {
        margin-bottom: 15px;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 12px 16px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* 调整按钮大小和间距 */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    /* 调整表格在小屏幕上的显示 */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    /* 调整文件附件的显示 */
    .col-md-4.mb-3 {
        width: 100%;
    }
    
    /* 触摸友好的UI元素 */
    a, button {
        touch-action: manipulation;
    }
    
    /* 增大表单元素的点击区域 */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        padding: 10px;
    }
}

/* 手机竖屏模式 */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* 调整文件显示布局 */
    .row.mt-2 {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* 确保文件预览自适应屏幕 */
    img, video, audio {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .btn:active {
        transform: scale(0.98);
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}